package com.wicket.okrbff.biz.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.wicket.okrapp.dal.po.mbg.OmsDualHighTaskRelationship;
import com.wicket.okrapp.integration.FwAppDualHighTaskRelationshipClient;
import com.wicket.okrapp.integration.dto.OmsDualHighFrameworkDataReqDto;
import com.wicket.okrapp.integration.dto.OmsDualHighTaskRelationshipReqDto;
import com.wicket.okrbff.biz.service.DualHighTaskRelationshipService;
import org.apache.skywalking.apm.toolkit.trace.Tag;
import org.apache.skywalking.apm.toolkit.trace.Tags;
import org.apache.skywalking.apm.toolkit.trace.Trace;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author  CHS
 * @since 2025-10-02
 *
 *
 * @version 1.0
 */
@Service
public class DualHighTaskRelationshipServiceImpl  implements DualHighTaskRelationshipService {

    @Resource
    FwAppDualHighTaskRelationshipClient client;

    /**
     * 查双高标准框架数据列表[2536]
     * gen by moon at 10/15/2022, 9:58:55 PM
     */
    @Trace(operationName = "查双高标准框架数据列表")
    @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
    @Override
    @Transactional(rollbackFor=Exception.class)
    public  List<OmsDualHighTaskRelationship>  queryDualHighTaskRelationshipList(OmsDualHighTaskRelationship obj) {
        return client.list(BeanUtil.toBean(obj, OmsDualHighTaskRelationshipReqDto.class)).getData();
    }

    /**
     * 查双高标准框架数据详情[2515]
     * gen by moon at 4/24/2023, 12:54:06 AM
     */
    @Trace(operationName = "查双高标准框架数据详情")
    @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
    @Override
    @Transactional(rollbackFor=Exception.class)
    public  OmsDualHighTaskRelationship  queryDualHighTaskRelationshipDetail(OmsDualHighTaskRelationship obj) {

        return client.detail(BeanUtil.toBean(obj, OmsDualHighTaskRelationshipReqDto.class)).getData();
    }

    /**
     * 新增双高标准框架数据[2346]
     * gen by moon at 10/15/2022, 9:58:53 PM
     */
    @Trace(operationName = "新增双高标准框架数据")
    @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
    @Override
    @Transactional(rollbackFor=Exception.class)
    public  String  addDualHighTaskRelationship(OmsDualHighTaskRelationship obj) {
        return client.add(BeanUtil.toBean(obj, OmsDualHighTaskRelationshipReqDto.class)).getData();
    }

    /**
     * 修改双高标准框架数据[2917]
     * gen by moon at 10/15/2022, 9:58:56 PM
     */
    @Trace(operationName = "修改双高标准框架数据")
    @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
    @Override
    @Transactional(rollbackFor=Exception.class)
    public  boolean  updateDualHighTaskRelationship(OmsDualHighTaskRelationship obj) {
        return  client.update(BeanUtil.toBean(obj, OmsDualHighTaskRelationshipReqDto.class)).getData();
    }

    /**
     * 删除双高标准框架数据[4092]
     * gen by moon at 10/15/2022, 9:58:58 PM
     */
    @Trace(operationName = "删除双高标准框架数据")
    @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
    @Override
    @Transactional(rollbackFor=Exception.class)
    public  boolean  deleteDualHighTaskRelationship(String id ) {
        OmsDualHighTaskRelationship obj = new OmsDualHighTaskRelationship();
        obj.setIndicatorId(id);
        return client.delete(BeanUtil.toBean(obj, OmsDualHighTaskRelationshipReqDto.class)).getData();
    }


    /**
     * 维护双高标准框架数据[2917]
     * gen by moon at 10/15/2022, 9:58:56 PM
     */
    @Trace(operationName = "维护双高标准框架数据")
    @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
    @Override
    @Transactional(rollbackFor=Exception.class)
    public  boolean  changeDualHighTaskRelationship(OmsDualHighTaskRelationship obj) {
        return  client.change(BeanUtil.toBean(obj, OmsDualHighTaskRelationshipReqDto.class)).getData();
    }

}
